package com.ming.springboot.config.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ZSetOperations;

/**
 * Created by mqsi on 2022/5/20 15:35
 */
@Configuration
public class RedisManager {

	@Autowired
	RedisTemplate redisTemplate;

	public RedisTemplate getRedisTemplate(){
		return redisTemplate;
	}

	public ValueOperations opsForValue(){
		return redisTemplate.opsForValue();
	}

	public HashOperations opsForHash(){
		return redisTemplate.opsForHash();
	}

	public ListOperations opsForList(){
		return redisTemplate.opsForList();
	}

	public SetOperations opsForSet(){
		return redisTemplate.opsForSet();
	}

	public ZSetOperations opsForZSet(){
		return redisTemplate.opsForZSet();
	}
}
